package com.runshu.newsmartark.mvp.presenter;


import com.runshu.newsmartark.mvp.contract.FaceManagerContract;
import com.runshu.newsmartark.network.netbean.ResponseBean;
import com.runshu.newsmartark.network.netinterface.MyCallBack;

/**
 * Demo class
 *
 * @author yu
 * @date 2020/8/10
 * @decs：
 */

public class FaceManagerPresenter implements FaceManagerContract.Presenter {
    private FaceManagerContract.View view;
    private FaceManagerContract.Model model;

    public FaceManagerPresenter(FaceManagerContract.View view, FaceManagerContract.Model model) {
        this.view = view;
        this.model = model;
    }

    @Override
    public void getFaceList() {
        model.getFaceList( new MyCallBack() {
            @Override
            public void onSuccess(ResponseBean data) {
                view.onGetFaceListSuccess(data);
            }

            @Override
            public void onError(ResponseBean data) {
                view.onError(data.getMessage());

            }

            @Override
            public void onErrorForOthers(ResponseBean msg) {
                view.onError(msg.getMessage());
            }
        });
    }
}